package cn.xlbweb.sso.config;

import cn.xlbweb.sso.listener.SsoSessionListener;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: bobi
 * @date: 2019-03-24 19:06
 * @description:
 */
@Configuration
@Slf4j
public class SsoWebConfig implements WebMvcConfigurer {

    @Bean
    public ServletListenerRegistrationBean servletListenerRegistrationBean() {
        log.info("SsoSessionListener init");
        ServletListenerRegistrationBean srb = new ServletListenerRegistrationBean();
        srb.setListener(new SsoSessionListener());
        return srb;
    }
}
